package com.ccut.xunfeiSpringboot.service;

import com.ccut.xunfeiSpringboot.entity.Student;
import com.ccut.xunfeiSpringboot.exception.CustomException;
import com.github.pagehelper.PageInfo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface StudentService {
    void add(Student student);
    void deleteById(Integer id);
    void update(Student student);
    List<Student> selectAll();
    Student selectById(Integer id);
    PageInfo<Student> selectPage(Integer pageNum, Integer pageSize);
    void register(Student student); // 保留注册方法

    //  添加 login 方法
    Student login(String username);

    boolean existsByUsername(String username);

    @Transactional
    Student login(Student student);

}